//
//  HZBaseRoomViewController.m
//  Model
//
//  Created by zeb-apple on 2017/6/2.
//  Copyright © 2017年 YDJH. All rights reserved.
//

#import "HZBaseRoomViewController.h"
#import "FurnitureActionView.h"
#import "RoomSmallMap.h"
#import "HZCommand.h"
#import "HZFurniture.h"
#import "HZFurniture_Header.h"
#import "HZRoomLogic.h"

@interface HZBaseRoomViewController ()


@end

@implementation HZBaseRoomViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
}
- (FurnitureActionView *)actionView {
    if (!_actionView) {
        __weak typeof(self) weakSelf = self;
        _actionView = [[FurnitureActionView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, Mine_H) actionClickBlock:^(HZFurniture *furniture, HZCommand *command) {
            
            [weakSelf actionWithFurniture:furniture command:command];
        }];
        _actionView.backgroundColor = [UIColor brownColor];
    }
    return _actionView;
}
- (RoomSmallMap *)roomSmallMap {
    if (!_roomSmallMap) {
        _roomSmallMap = [[RoomSmallMap alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-100,0,100, 66)];
    }
    return _roomSmallMap;
}
- (void)actionWithFurniture:(HZFurniture *)furniture command:(HZCommand *)command {
    [HZRoomLogic changeFurnitureState:furniture withCommandName:command.commandName];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [self.actionView dissmiss];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
